package com.apimarket.entity.kong;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;
import java.util.List;

/**
 * key-auth插件绑定消费者的秘钥实体
 *
 * @author yyc
 */
public class KeyAuthCredential {
    private Consumer consumer;

    @JsonProperty("created_at")
    private Date createdAt;

    private String message;
    private String id;
    //这里保存的是生成的秘钥
    private String key;

    /**
     * tags ttl暂不知道有何作用，此处只为适配json转换
     */
    private List<String> tags;

    private String ttl;

    public class Consumer {
        private String id;

        public Consumer() {
        }

        public Consumer(String id) {
            this.id = id;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        @Override
        public String toString() {
            final StringBuilder sb = new StringBuilder("Consumer{");
            sb.append("id='").append(id).append('\'');
            sb.append('}');
            return sb.toString();
        }
    }

    public Consumer getConsumer() {
        return consumer;
    }

    public void setConsumer(Consumer consumer) {
        this.consumer = consumer;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public String getMessage() {
        return message;
    }

    public String getId() {
        return id;
    }

    public void setMessage(String message) {
        this.message=message;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public String getTtl() {
        return ttl;
    }

    public void setTtl(String ttl) {
        this.ttl = ttl;
    }


    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("KeyAuthCredential{");
        sb.append("consumer=").append(consumer);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", id='").append(id).append('\'');
        sb.append(", key='").append(key).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
